package com.example.xyblog.Common;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Configuration
public class LoginConfigure implements WebMvcConfigurer {
    @Autowired
    private LoginIntercepter loginIntercepter;
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(loginIntercepter)
                .addPathPatterns("/**")
                .excludePathPatterns("/**/*.html")
                .excludePathPatterns("/css/*.css")
                .excludePathPatterns("/image/**")
                .excludePathPatterns("/user/login")
                .excludePathPatterns("/js/**")
                .excludePathPatterns("/user/reg")
                .excludePathPatterns("/user/identifyImage")
                .excludePathPatterns("/art/getBlog")
                .excludePathPatterns("/editor.md/**")
                .excludePathPatterns("/editor.min.css/**")
                .excludePathPatterns("/art/getAll")
                .excludePathPatterns("/comment/getComment")
                .excludePathPatterns("/user/getAuthurInfo")
                .excludePathPatterns("/user/photoUploadByArt")
                .excludePathPatterns("/art/thumb")
                .excludePathPatterns("/art/getTotal")
                .excludePathPatterns("/art/getCut");

    }
}
